{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Project 1: Deaths by tuberculosis\n",
    "\n",
    "by Michel Wermelinger and Andres Muniz, 08 November 2015\n",
    "\n",
    "This is the project notebook for Week 1 of The Open University's [_Learn to code for Data Analysis_](http://futurelearn.com/courses/learn-to-code) course.\n",
    "\n",
    "In 2000, the United Nations set eight Millenium Development Goals (MDGs) to reduce poverty and diseases, improve gender equality and environmental sustainability, etc. Each goal is quantified and time-bound, to be achieved by the end of 2015. Goal 6 is to have halted and started reversing the spread of HIV, malaria and tuberculosis (TB).\n",
    "TB doesn't make headlines like Ebola, SARS (severe acute respiratory syndrome) and other epidemics, but is far deadlier. For more information, see the World Health Organisation (WHO) page <http://www.who.int/gho/tb/en/>.\n",
    "\n",
    "Given the population and number of deaths due to TB in all countries during one year, the following questions will be answered: \n",
    "\n",
    "- What is the total, maximum, minimum and average number of deaths in that year?\n",
    "- Which countries have the most and the least deaths?\n",
    "- What is the death rate (deaths per 100,000 inhabitants) for each country?\n",
    "- Which countries have the lowest and highest death rate?\n",
    "\n",
    "The death rate allows for a better comparison of countries with widely different population sizes."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The data\n",
    "\n",
    "The data consists of total population and total number of deaths due to TB (excluding HIV) in 2013 in each of the BRICS and Portuguese-speaking countries. \n",
    "\n",
    "The data was taken from <http://apps.who.int/gho/data/node.main.POP107?lang=en> (population) and <http://apps.who.int/gho/data/node.main.593?lang=en> (deaths). The uncertainty bounds of the number of deaths were ignored.\n",
    "\n",
    "The data was collected into an Excel file which should be in the same folder as this notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Population (1000s)</th>\n",
       "      <th>TB deaths</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>30552</td>\n",
       "      <td>13000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Albania</td>\n",
       "      <td>3173</td>\n",
       "      <td>20.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>39208</td>\n",
       "      <td>5100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Andorra</td>\n",
       "      <td>79</td>\n",
       "      <td>0.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Angola</td>\n",
       "      <td>21472</td>\n",
       "      <td>6900.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>90</td>\n",
       "      <td>1.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Argentina</td>\n",
       "      <td>41446</td>\n",
       "      <td>570.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Armenia</td>\n",
       "      <td>2977</td>\n",
       "      <td>170.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Australia</td>\n",
       "      <td>23343</td>\n",
       "      <td>45.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Austria</td>\n",
       "      <td>8495</td>\n",
       "      <td>29.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Azerbaijan</td>\n",
       "      <td>9413</td>\n",
       "      <td>360.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Bahamas</td>\n",
       "      <td>377</td>\n",
       "      <td>1.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Bahrain</td>\n",
       "      <td>1332</td>\n",
       "      <td>9.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Bangladesh</td>\n",
       "      <td>156595</td>\n",
       "      <td>80000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Barbados</td>\n",
       "      <td>285</td>\n",
       "      <td>2.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Belarus</td>\n",
       "      <td>9357</td>\n",
       "      <td>850.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Belgium</td>\n",
       "      <td>11104</td>\n",
       "      <td>18.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Belize</td>\n",
       "      <td>332</td>\n",
       "      <td>20.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Benin</td>\n",
       "      <td>10323</td>\n",
       "      <td>1300.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Bhutan</td>\n",
       "      <td>754</td>\n",
       "      <td>88.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Bolivia (Plurinational State of)</td>\n",
       "      <td>10671</td>\n",
       "      <td>430.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Bosnia and Herzegovina</td>\n",
       "      <td>3829</td>\n",
       "      <td>190.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Botswana</td>\n",
       "      <td>2021</td>\n",
       "      <td>440.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>200362</td>\n",
       "      <td>4400.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Brunei Darussalam</td>\n",
       "      <td>418</td>\n",
       "      <td>13.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>Bulgaria</td>\n",
       "      <td>7223</td>\n",
       "      <td>150.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>Burkina Faso</td>\n",
       "      <td>16935</td>\n",
       "      <td>1500.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Burundi</td>\n",
       "      <td>10163</td>\n",
       "      <td>2300.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>CÃ´te d'Ivoire</td>\n",
       "      <td>20316</td>\n",
       "      <td>4000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Cabo Verde</td>\n",
       "      <td>499</td>\n",
       "      <td>150.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>Suriname</td>\n",
       "      <td>539</td>\n",
       "      <td>12.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>Swaziland</td>\n",
       "      <td>1250</td>\n",
       "      <td>1100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>9571</td>\n",
       "      <td>13.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>8078</td>\n",
       "      <td>17.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168</th>\n",
       "      <td>Syrian Arab Republic</td>\n",
       "      <td>21898</td>\n",
       "      <td>450.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>169</th>\n",
       "      <td>Tajikistan</td>\n",
       "      <td>8208</td>\n",
       "      <td>570.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>Thailand</td>\n",
       "      <td>67010</td>\n",
       "      <td>8100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>The former Yugoslav republic of Macedonia</td>\n",
       "      <td>2107</td>\n",
       "      <td>33.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>Timor-Leste</td>\n",
       "      <td>1133</td>\n",
       "      <td>990.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>Togo</td>\n",
       "      <td>6817</td>\n",
       "      <td>810.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>Tonga</td>\n",
       "      <td>105</td>\n",
       "      <td>2.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>Trinidad and Tobago</td>\n",
       "      <td>1341</td>\n",
       "      <td>29.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>Tunisia</td>\n",
       "      <td>10997</td>\n",
       "      <td>230.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>Turkey</td>\n",
       "      <td>74933</td>\n",
       "      <td>310.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>Turkmenistan</td>\n",
       "      <td>5240</td>\n",
       "      <td>1300.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Tuvalu</td>\n",
       "      <td>10</td>\n",
       "      <td>2.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>Uganda</td>\n",
       "      <td>37579</td>\n",
       "      <td>4100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>45239</td>\n",
       "      <td>6600.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>United Arab Emirates</td>\n",
       "      <td>9346</td>\n",
       "      <td>64.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>United Kingdom of Great Britain and Northern I...</td>\n",
       "      <td>63136</td>\n",
       "      <td>340.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>United Republic of Tanzania</td>\n",
       "      <td>49253</td>\n",
       "      <td>6000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>United States of America</td>\n",
       "      <td>320051</td>\n",
       "      <td>490.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>Uruguay</td>\n",
       "      <td>3407</td>\n",
       "      <td>40.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>Uzbekistan</td>\n",
       "      <td>28934</td>\n",
       "      <td>2200.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>Vanuatu</td>\n",
       "      <td>253</td>\n",
       "      <td>16.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>Venezuela (Bolivarian Republic of)</td>\n",
       "      <td>30405</td>\n",
       "      <td>480.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>Viet Nam</td>\n",
       "      <td>91680</td>\n",
       "      <td>17000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>Yemen</td>\n",
       "      <td>24407</td>\n",
       "      <td>990.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>Zambia</td>\n",
       "      <td>14539</td>\n",
       "      <td>3600.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>14150</td>\n",
       "      <td>5700.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>194 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               Country  Population (1000s)  \\\n",
       "0                                          Afghanistan               30552   \n",
       "1                                              Albania                3173   \n",
       "2                                              Algeria               39208   \n",
       "3                                              Andorra                  79   \n",
       "4                                               Angola               21472   \n",
       "5                                  Antigua and Barbuda                  90   \n",
       "6                                            Argentina               41446   \n",
       "7                                              Armenia                2977   \n",
       "8                                            Australia               23343   \n",
       "9                                              Austria                8495   \n",
       "10                                          Azerbaijan                9413   \n",
       "11                                             Bahamas                 377   \n",
       "12                                             Bahrain                1332   \n",
       "13                                          Bangladesh              156595   \n",
       "14                                            Barbados                 285   \n",
       "15                                             Belarus                9357   \n",
       "16                                             Belgium               11104   \n",
       "17                                              Belize                 332   \n",
       "18                                               Benin               10323   \n",
       "19                                              Bhutan                 754   \n",
       "20                    Bolivia (Plurinational State of)               10671   \n",
       "21                              Bosnia and Herzegovina                3829   \n",
       "22                                            Botswana                2021   \n",
       "23                                              Brazil              200362   \n",
       "24                                   Brunei Darussalam                 418   \n",
       "25                                            Bulgaria                7223   \n",
       "26                                        Burkina Faso               16935   \n",
       "27                                             Burundi               10163   \n",
       "28                                      CÃ´te d'Ivoire               20316   \n",
       "29                                          Cabo Verde                 499   \n",
       "..                                                 ...                 ...   \n",
       "164                                           Suriname                 539   \n",
       "165                                          Swaziland                1250   \n",
       "166                                             Sweden                9571   \n",
       "167                                        Switzerland                8078   \n",
       "168                               Syrian Arab Republic               21898   \n",
       "169                                         Tajikistan                8208   \n",
       "170                                           Thailand               67010   \n",
       "171          The former Yugoslav republic of Macedonia                2107   \n",
       "172                                        Timor-Leste                1133   \n",
       "173                                               Togo                6817   \n",
       "174                                              Tonga                 105   \n",
       "175                                Trinidad and Tobago                1341   \n",
       "176                                            Tunisia               10997   \n",
       "177                                             Turkey               74933   \n",
       "178                                       Turkmenistan                5240   \n",
       "179                                             Tuvalu                  10   \n",
       "180                                             Uganda               37579   \n",
       "181                                            Ukraine               45239   \n",
       "182                               United Arab Emirates                9346   \n",
       "183  United Kingdom of Great Britain and Northern I...               63136   \n",
       "184                        United Republic of Tanzania               49253   \n",
       "185                           United States of America              320051   \n",
       "186                                            Uruguay                3407   \n",
       "187                                         Uzbekistan               28934   \n",
       "188                                            Vanuatu                 253   \n",
       "189                 Venezuela (Bolivarian Republic of)               30405   \n",
       "190                                           Viet Nam               91680   \n",
       "191                                              Yemen               24407   \n",
       "192                                             Zambia               14539   \n",
       "193                                           Zimbabwe               14150   \n",
       "\n",
       "     TB deaths  \n",
       "0     13000.00  \n",
       "1        20.00  \n",
       "2      5100.00  \n",
       "3         0.26  \n",
       "4      6900.00  \n",
       "5         1.20  \n",
       "6       570.00  \n",
       "7       170.00  \n",
       "8        45.00  \n",
       "9        29.00  \n",
       "10      360.00  \n",
       "11        1.80  \n",
       "12        9.60  \n",
       "13    80000.00  \n",
       "14        2.00  \n",
       "15      850.00  \n",
       "16       18.00  \n",
       "17       20.00  \n",
       "18     1300.00  \n",
       "19       88.00  \n",
       "20      430.00  \n",
       "21      190.00  \n",
       "22      440.00  \n",
       "23     4400.00  \n",
       "24       13.00  \n",
       "25      150.00  \n",
       "26     1500.00  \n",
       "27     2300.00  \n",
       "28     4000.00  \n",
       "29      150.00  \n",
       "..         ...  \n",
       "164      12.00  \n",
       "165    1100.00  \n",
       "166      13.00  \n",
       "167      17.00  \n",
       "168     450.00  \n",
       "169     570.00  \n",
       "170    8100.00  \n",
       "171      33.00  \n",
       "172     990.00  \n",
       "173     810.00  \n",
       "174       2.50  \n",
       "175      29.00  \n",
       "176     230.00  \n",
       "177     310.00  \n",
       "178    1300.00  \n",
       "179       2.80  \n",
       "180    4100.00  \n",
       "181    6600.00  \n",
       "182      64.00  \n",
       "183     340.00  \n",
       "184    6000.00  \n",
       "185     490.00  \n",
       "186      40.00  \n",
       "187    2200.00  \n",
       "188      16.00  \n",
       "189     480.00  \n",
       "190   17000.00  \n",
       "191     990.00  \n",
       "192    3600.00  \n",
       "193    5700.00  \n",
       "\n",
       "[194 rows x 3 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pandas import *\n",
    "data = read_excel('WHO POP TB all.xls')\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The range of the problem\n",
    "\n",
    "The column of interest is the last one."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "tbColumn = data['TB deaths']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The total number of deaths in 2013 is:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1072677.97"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbColumn.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The largest and smallest number of deaths in a single country are:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "240000.0"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbColumn.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.0"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbColumn.min()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "From 0 to almost a quarter of a million deaths is a huge range. The average number of deaths, over all countries in the data, can give a better idea of the seriousness of the problem in each country.\n",
    "The average can be computed as the mean or the median. Given the wide range of deaths, the median is probably a more sensible average measure."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5529.2678865979378"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbColumn.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "315.0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tbColumn.median()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The median is far lower than the mean. This indicates that some of the countries had a very high number of TB deaths in 2013, pushing the value of the mean up."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The most affected\n",
    "\n",
    "To see the most affected countries, the table is sorted in ascending order by the last column, which puts those countries in the last rows."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.4/dist-packages/ipykernel/__main__.py:1: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)\n",
      "  if __name__ == '__main__':\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Population (1000s)</th>\n",
       "      <th>TB deaths</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>San Marino</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125</th>\n",
       "      <td>Niue</td>\n",
       "      <td>1</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>Monaco</td>\n",
       "      <td>38</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Andorra</td>\n",
       "      <td>79</td>\n",
       "      <td>0.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>Palau</td>\n",
       "      <td>21</td>\n",
       "      <td>0.36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>Cook Islands</td>\n",
       "      <td>21</td>\n",
       "      <td>0.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>Nauru</td>\n",
       "      <td>10</td>\n",
       "      <td>0.67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>Iceland</td>\n",
       "      <td>330</td>\n",
       "      <td>0.93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>Grenada</td>\n",
       "      <td>106</td>\n",
       "      <td>1.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>90</td>\n",
       "      <td>1.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>Montenegro</td>\n",
       "      <td>621</td>\n",
       "      <td>1.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>152</th>\n",
       "      <td>Seychelles</td>\n",
       "      <td>93</td>\n",
       "      <td>1.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105</th>\n",
       "      <td>Malta</td>\n",
       "      <td>429</td>\n",
       "      <td>1.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>143</th>\n",
       "      <td>Saint Kitts and Nevis</td>\n",
       "      <td>54</td>\n",
       "      <td>1.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Bahamas</td>\n",
       "      <td>377</td>\n",
       "      <td>1.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Barbados</td>\n",
       "      <td>285</td>\n",
       "      <td>2.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>144</th>\n",
       "      <td>Saint Lucia</td>\n",
       "      <td>182</td>\n",
       "      <td>2.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>Luxembourg</td>\n",
       "      <td>530</td>\n",
       "      <td>2.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>Cyprus</td>\n",
       "      <td>1141</td>\n",
       "      <td>2.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>Tonga</td>\n",
       "      <td>105</td>\n",
       "      <td>2.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>Dominica</td>\n",
       "      <td>72</td>\n",
       "      <td>2.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>Qatar</td>\n",
       "      <td>2169</td>\n",
       "      <td>2.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Tuvalu</td>\n",
       "      <td>10</td>\n",
       "      <td>2.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>Saint Vincent and the Grenadines</td>\n",
       "      <td>109</td>\n",
       "      <td>3.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>Norway</td>\n",
       "      <td>5043</td>\n",
       "      <td>4.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>Samoa</td>\n",
       "      <td>190</td>\n",
       "      <td>6.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>New Zealand</td>\n",
       "      <td>4506</td>\n",
       "      <td>6.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>Maldives</td>\n",
       "      <td>345</td>\n",
       "      <td>7.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Bahrain</td>\n",
       "      <td>1332</td>\n",
       "      <td>9.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>Suriname</td>\n",
       "      <td>539</td>\n",
       "      <td>12.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160</th>\n",
       "      <td>South Sudan</td>\n",
       "      <td>11296</td>\n",
       "      <td>4500.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>Nepal</td>\n",
       "      <td>27797</td>\n",
       "      <td>4600.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>39208</td>\n",
       "      <td>5100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>14150</td>\n",
       "      <td>5700.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>United Republic of Tanzania</td>\n",
       "      <td>49253</td>\n",
       "      <td>6000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>45239</td>\n",
       "      <td>6600.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>Democratic People's Republic of Korea</td>\n",
       "      <td>24895</td>\n",
       "      <td>6700.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Angola</td>\n",
       "      <td>21472</td>\n",
       "      <td>6900.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>Somalia</td>\n",
       "      <td>10496</td>\n",
       "      <td>7700.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>Cameroon</td>\n",
       "      <td>22254</td>\n",
       "      <td>7800.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>Thailand</td>\n",
       "      <td>67010</td>\n",
       "      <td>8100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>Kenya</td>\n",
       "      <td>44354</td>\n",
       "      <td>9100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>163</th>\n",
       "      <td>Sudan</td>\n",
       "      <td>37964</td>\n",
       "      <td>9700.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>Cambodia</td>\n",
       "      <td>15135</td>\n",
       "      <td>10000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>Madagascar</td>\n",
       "      <td>22925</td>\n",
       "      <td>12000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>30552</td>\n",
       "      <td>13000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>141</th>\n",
       "      <td>Russian Federation</td>\n",
       "      <td>142834</td>\n",
       "      <td>17000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>Viet Nam</td>\n",
       "      <td>91680</td>\n",
       "      <td>17000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>Mozambique</td>\n",
       "      <td>25834</td>\n",
       "      <td>18000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>52776</td>\n",
       "      <td>25000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>Myanmar</td>\n",
       "      <td>53259</td>\n",
       "      <td>26000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>Philippines</td>\n",
       "      <td>98394</td>\n",
       "      <td>27000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>Ethiopia</td>\n",
       "      <td>94101</td>\n",
       "      <td>30000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>China</td>\n",
       "      <td>1393337</td>\n",
       "      <td>41000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>Democratic Republic of the Congo</td>\n",
       "      <td>67514</td>\n",
       "      <td>46000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>128</th>\n",
       "      <td>Pakistan</td>\n",
       "      <td>182143</td>\n",
       "      <td>49000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>Indonesia</td>\n",
       "      <td>249866</td>\n",
       "      <td>64000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Bangladesh</td>\n",
       "      <td>156595</td>\n",
       "      <td>80000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>Nigeria</td>\n",
       "      <td>173615</td>\n",
       "      <td>160000.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>India</td>\n",
       "      <td>1252140</td>\n",
       "      <td>240000.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>194 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   Country  Population (1000s)  TB deaths\n",
       "147                             San Marino                  31       0.00\n",
       "125                                   Niue                   1       0.01\n",
       "111                                 Monaco                  38       0.03\n",
       "3                                  Andorra                  79       0.26\n",
       "129                                  Palau                  21       0.36\n",
       "40                            Cook Islands                  21       0.41\n",
       "118                                  Nauru                  10       0.67\n",
       "76                                 Iceland                 330       0.93\n",
       "68                                 Grenada                 106       1.10\n",
       "5                      Antigua and Barbuda                  90       1.20\n",
       "113                             Montenegro                 621       1.20\n",
       "152                             Seychelles                  93       1.40\n",
       "105                                  Malta                 429       1.50\n",
       "143                  Saint Kitts and Nevis                  54       1.60\n",
       "11                                 Bahamas                 377       1.80\n",
       "14                                Barbados                 285       2.00\n",
       "144                            Saint Lucia                 182       2.20\n",
       "99                              Luxembourg                 530       2.20\n",
       "44                                  Cyprus                1141       2.30\n",
       "174                                  Tonga                 105       2.50\n",
       "50                                Dominica                  72       2.70\n",
       "137                                  Qatar                2169       2.70\n",
       "179                                 Tuvalu                  10       2.80\n",
       "145       Saint Vincent and the Grenadines                 109       3.10\n",
       "126                                 Norway                5043       4.40\n",
       "146                                  Samoa                 190       6.10\n",
       "121                            New Zealand                4506       6.30\n",
       "103                               Maldives                 345       7.60\n",
       "12                                 Bahrain                1332       9.60\n",
       "164                               Suriname                 539      12.00\n",
       "..                                     ...                 ...        ...\n",
       "160                            South Sudan               11296    4500.00\n",
       "119                                  Nepal               27797    4600.00\n",
       "2                                  Algeria               39208    5100.00\n",
       "193                               Zimbabwe               14150    5700.00\n",
       "184            United Republic of Tanzania               49253    6000.00\n",
       "181                                Ukraine               45239    6600.00\n",
       "46   Democratic People's Republic of Korea               24895    6700.00\n",
       "4                                   Angola               21472    6900.00\n",
       "158                                Somalia               10496    7700.00\n",
       "31                                Cameroon               22254    7800.00\n",
       "170                               Thailand               67010    8100.00\n",
       "88                                   Kenya               44354    9100.00\n",
       "163                                  Sudan               37964    9700.00\n",
       "30                                Cambodia               15135   10000.00\n",
       "100                             Madagascar               22925   12000.00\n",
       "0                              Afghanistan               30552   13000.00\n",
       "141                     Russian Federation              142834   17000.00\n",
       "190                               Viet Nam               91680   17000.00\n",
       "115                             Mozambique               25834   18000.00\n",
       "159                           South Africa               52776   25000.00\n",
       "116                                Myanmar               53259   26000.00\n",
       "134                            Philippines               98394   27000.00\n",
       "58                                Ethiopia               94101   30000.00\n",
       "36                                   China             1393337   41000.00\n",
       "47        Democratic Republic of the Congo               67514   46000.00\n",
       "128                               Pakistan              182143   49000.00\n",
       "78                               Indonesia              249866   64000.00\n",
       "13                              Bangladesh              156595   80000.00\n",
       "124                                Nigeria              173615  160000.00\n",
       "77                                   India             1252140  240000.00\n",
       "\n",
       "[194 rows x 3 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.sort('TB deaths')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The table raises the possibility that a large number of deaths may be partly due to a large population. To compare the countries on an equal footing, the death rate per 100,000 inhabitants is computed."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Population (1000s)</th>\n",
       "      <th>TB deaths</th>\n",
       "      <th>TB deaths (per 100,000)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>30552</td>\n",
       "      <td>13000.00</td>\n",
       "      <td>42.550406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Albania</td>\n",
       "      <td>3173</td>\n",
       "      <td>20.00</td>\n",
       "      <td>0.630318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>39208</td>\n",
       "      <td>5100.00</td>\n",
       "      <td>13.007549</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Andorra</td>\n",
       "      <td>79</td>\n",
       "      <td>0.26</td>\n",
       "      <td>0.329114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Angola</td>\n",
       "      <td>21472</td>\n",
       "      <td>6900.00</td>\n",
       "      <td>32.134873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>90</td>\n",
       "      <td>1.20</td>\n",
       "      <td>1.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Argentina</td>\n",
       "      <td>41446</td>\n",
       "      <td>570.00</td>\n",
       "      <td>1.375284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Armenia</td>\n",
       "      <td>2977</td>\n",
       "      <td>170.00</td>\n",
       "      <td>5.710447</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Australia</td>\n",
       "      <td>23343</td>\n",
       "      <td>45.00</td>\n",
       "      <td>0.192777</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Austria</td>\n",
       "      <td>8495</td>\n",
       "      <td>29.00</td>\n",
       "      <td>0.341377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Azerbaijan</td>\n",
       "      <td>9413</td>\n",
       "      <td>360.00</td>\n",
       "      <td>3.824498</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Bahamas</td>\n",
       "      <td>377</td>\n",
       "      <td>1.80</td>\n",
       "      <td>0.477454</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Bahrain</td>\n",
       "      <td>1332</td>\n",
       "      <td>9.60</td>\n",
       "      <td>0.720721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Bangladesh</td>\n",
       "      <td>156595</td>\n",
       "      <td>80000.00</td>\n",
       "      <td>51.087199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Barbados</td>\n",
       "      <td>285</td>\n",
       "      <td>2.00</td>\n",
       "      <td>0.701754</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Belarus</td>\n",
       "      <td>9357</td>\n",
       "      <td>850.00</td>\n",
       "      <td>9.084108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Belgium</td>\n",
       "      <td>11104</td>\n",
       "      <td>18.00</td>\n",
       "      <td>0.162104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Belize</td>\n",
       "      <td>332</td>\n",
       "      <td>20.00</td>\n",
       "      <td>6.024096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Benin</td>\n",
       "      <td>10323</td>\n",
       "      <td>1300.00</td>\n",
       "      <td>12.593238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Bhutan</td>\n",
       "      <td>754</td>\n",
       "      <td>88.00</td>\n",
       "      <td>11.671088</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Bolivia (Plurinational State of)</td>\n",
       "      <td>10671</td>\n",
       "      <td>430.00</td>\n",
       "      <td>4.029613</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Bosnia and Herzegovina</td>\n",
       "      <td>3829</td>\n",
       "      <td>190.00</td>\n",
       "      <td>4.962131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Botswana</td>\n",
       "      <td>2021</td>\n",
       "      <td>440.00</td>\n",
       "      <td>21.771400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Brazil</td>\n",
       "      <td>200362</td>\n",
       "      <td>4400.00</td>\n",
       "      <td>2.196025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Brunei Darussalam</td>\n",
       "      <td>418</td>\n",
       "      <td>13.00</td>\n",
       "      <td>3.110048</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>Bulgaria</td>\n",
       "      <td>7223</td>\n",
       "      <td>150.00</td>\n",
       "      <td>2.076699</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>Burkina Faso</td>\n",
       "      <td>16935</td>\n",
       "      <td>1500.00</td>\n",
       "      <td>8.857396</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Burundi</td>\n",
       "      <td>10163</td>\n",
       "      <td>2300.00</td>\n",
       "      <td>22.631113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>CÃ´te d'Ivoire</td>\n",
       "      <td>20316</td>\n",
       "      <td>4000.00</td>\n",
       "      <td>19.688915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Cabo Verde</td>\n",
       "      <td>499</td>\n",
       "      <td>150.00</td>\n",
       "      <td>30.060120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>Suriname</td>\n",
       "      <td>539</td>\n",
       "      <td>12.00</td>\n",
       "      <td>2.226345</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>Swaziland</td>\n",
       "      <td>1250</td>\n",
       "      <td>1100.00</td>\n",
       "      <td>88.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>9571</td>\n",
       "      <td>13.00</td>\n",
       "      <td>0.135827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>8078</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0.210448</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>168</th>\n",
       "      <td>Syrian Arab Republic</td>\n",
       "      <td>21898</td>\n",
       "      <td>450.00</td>\n",
       "      <td>2.054982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>169</th>\n",
       "      <td>Tajikistan</td>\n",
       "      <td>8208</td>\n",
       "      <td>570.00</td>\n",
       "      <td>6.944444</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>Thailand</td>\n",
       "      <td>67010</td>\n",
       "      <td>8100.00</td>\n",
       "      <td>12.087748</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>The former Yugoslav republic of Macedonia</td>\n",
       "      <td>2107</td>\n",
       "      <td>33.00</td>\n",
       "      <td>1.566208</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>Timor-Leste</td>\n",
       "      <td>1133</td>\n",
       "      <td>990.00</td>\n",
       "      <td>87.378641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>Togo</td>\n",
       "      <td>6817</td>\n",
       "      <td>810.00</td>\n",
       "      <td>11.882060</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>Tonga</td>\n",
       "      <td>105</td>\n",
       "      <td>2.50</td>\n",
       "      <td>2.380952</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>Trinidad and Tobago</td>\n",
       "      <td>1341</td>\n",
       "      <td>29.00</td>\n",
       "      <td>2.162565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>Tunisia</td>\n",
       "      <td>10997</td>\n",
       "      <td>230.00</td>\n",
       "      <td>2.091479</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>Turkey</td>\n",
       "      <td>74933</td>\n",
       "      <td>310.00</td>\n",
       "      <td>0.413703</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>Turkmenistan</td>\n",
       "      <td>5240</td>\n",
       "      <td>1300.00</td>\n",
       "      <td>24.809160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>Tuvalu</td>\n",
       "      <td>10</td>\n",
       "      <td>2.80</td>\n",
       "      <td>28.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>Uganda</td>\n",
       "      <td>37579</td>\n",
       "      <td>4100.00</td>\n",
       "      <td>10.910349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>45239</td>\n",
       "      <td>6600.00</td>\n",
       "      <td>14.589182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>United Arab Emirates</td>\n",
       "      <td>9346</td>\n",
       "      <td>64.00</td>\n",
       "      <td>0.684785</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>United Kingdom of Great Britain and Northern I...</td>\n",
       "      <td>63136</td>\n",
       "      <td>340.00</td>\n",
       "      <td>0.538520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>United Republic of Tanzania</td>\n",
       "      <td>49253</td>\n",
       "      <td>6000.00</td>\n",
       "      <td>12.181999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>United States of America</td>\n",
       "      <td>320051</td>\n",
       "      <td>490.00</td>\n",
       "      <td>0.153101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>Uruguay</td>\n",
       "      <td>3407</td>\n",
       "      <td>40.00</td>\n",
       "      <td>1.174053</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>Uzbekistan</td>\n",
       "      <td>28934</td>\n",
       "      <td>2200.00</td>\n",
       "      <td>7.603511</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>Vanuatu</td>\n",
       "      <td>253</td>\n",
       "      <td>16.00</td>\n",
       "      <td>6.324111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>Venezuela (Bolivarian Republic of)</td>\n",
       "      <td>30405</td>\n",
       "      <td>480.00</td>\n",
       "      <td>1.578688</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>Viet Nam</td>\n",
       "      <td>91680</td>\n",
       "      <td>17000.00</td>\n",
       "      <td>18.542757</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>Yemen</td>\n",
       "      <td>24407</td>\n",
       "      <td>990.00</td>\n",
       "      <td>4.056213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>Zambia</td>\n",
       "      <td>14539</td>\n",
       "      <td>3600.00</td>\n",
       "      <td>24.760988</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>14150</td>\n",
       "      <td>5700.00</td>\n",
       "      <td>40.282686</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>194 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               Country  Population (1000s)  \\\n",
       "0                                          Afghanistan               30552   \n",
       "1                                              Albania                3173   \n",
       "2                                              Algeria               39208   \n",
       "3                                              Andorra                  79   \n",
       "4                                               Angola               21472   \n",
       "5                                  Antigua and Barbuda                  90   \n",
       "6                                            Argentina               41446   \n",
       "7                                              Armenia                2977   \n",
       "8                                            Australia               23343   \n",
       "9                                              Austria                8495   \n",
       "10                                          Azerbaijan                9413   \n",
       "11                                             Bahamas                 377   \n",
       "12                                             Bahrain                1332   \n",
       "13                                          Bangladesh              156595   \n",
       "14                                            Barbados                 285   \n",
       "15                                             Belarus                9357   \n",
       "16                                             Belgium               11104   \n",
       "17                                              Belize                 332   \n",
       "18                                               Benin               10323   \n",
       "19                                              Bhutan                 754   \n",
       "20                    Bolivia (Plurinational State of)               10671   \n",
       "21                              Bosnia and Herzegovina                3829   \n",
       "22                                            Botswana                2021   \n",
       "23                                              Brazil              200362   \n",
       "24                                   Brunei Darussalam                 418   \n",
       "25                                            Bulgaria                7223   \n",
       "26                                        Burkina Faso               16935   \n",
       "27                                             Burundi               10163   \n",
       "28                                      CÃ´te d'Ivoire               20316   \n",
       "29                                          Cabo Verde                 499   \n",
       "..                                                 ...                 ...   \n",
       "164                                           Suriname                 539   \n",
       "165                                          Swaziland                1250   \n",
       "166                                             Sweden                9571   \n",
       "167                                        Switzerland                8078   \n",
       "168                               Syrian Arab Republic               21898   \n",
       "169                                         Tajikistan                8208   \n",
       "170                                           Thailand               67010   \n",
       "171          The former Yugoslav republic of Macedonia                2107   \n",
       "172                                        Timor-Leste                1133   \n",
       "173                                               Togo                6817   \n",
       "174                                              Tonga                 105   \n",
       "175                                Trinidad and Tobago                1341   \n",
       "176                                            Tunisia               10997   \n",
       "177                                             Turkey               74933   \n",
       "178                                       Turkmenistan                5240   \n",
       "179                                             Tuvalu                  10   \n",
       "180                                             Uganda               37579   \n",
       "181                                            Ukraine               45239   \n",
       "182                               United Arab Emirates                9346   \n",
       "183  United Kingdom of Great Britain and Northern I...               63136   \n",
       "184                        United Republic of Tanzania               49253   \n",
       "185                           United States of America              320051   \n",
       "186                                            Uruguay                3407   \n",
       "187                                         Uzbekistan               28934   \n",
       "188                                            Vanuatu                 253   \n",
       "189                 Venezuela (Bolivarian Republic of)               30405   \n",
       "190                                           Viet Nam               91680   \n",
       "191                                              Yemen               24407   \n",
       "192                                             Zambia               14539   \n",
       "193                                           Zimbabwe               14150   \n",
       "\n",
       "     TB deaths  TB deaths (per 100,000)  \n",
       "0     13000.00                42.550406  \n",
       "1        20.00                 0.630318  \n",
       "2      5100.00                13.007549  \n",
       "3         0.26                 0.329114  \n",
       "4      6900.00                32.134873  \n",
       "5         1.20                 1.333333  \n",
       "6       570.00                 1.375284  \n",
       "7       170.00                 5.710447  \n",
       "8        45.00                 0.192777  \n",
       "9        29.00                 0.341377  \n",
       "10      360.00                 3.824498  \n",
       "11        1.80                 0.477454  \n",
       "12        9.60                 0.720721  \n",
       "13    80000.00                51.087199  \n",
       "14        2.00                 0.701754  \n",
       "15      850.00                 9.084108  \n",
       "16       18.00                 0.162104  \n",
       "17       20.00                 6.024096  \n",
       "18     1300.00                12.593238  \n",
       "19       88.00                11.671088  \n",
       "20      430.00                 4.029613  \n",
       "21      190.00                 4.962131  \n",
       "22      440.00                21.771400  \n",
       "23     4400.00                 2.196025  \n",
       "24       13.00                 3.110048  \n",
       "25      150.00                 2.076699  \n",
       "26     1500.00                 8.857396  \n",
       "27     2300.00                22.631113  \n",
       "28     4000.00                19.688915  \n",
       "29      150.00                30.060120  \n",
       "..         ...                      ...  \n",
       "164      12.00                 2.226345  \n",
       "165    1100.00                88.000000  \n",
       "166      13.00                 0.135827  \n",
       "167      17.00                 0.210448  \n",
       "168     450.00                 2.054982  \n",
       "169     570.00                 6.944444  \n",
       "170    8100.00                12.087748  \n",
       "171      33.00                 1.566208  \n",
       "172     990.00                87.378641  \n",
       "173     810.00                11.882060  \n",
       "174       2.50                 2.380952  \n",
       "175      29.00                 2.162565  \n",
       "176     230.00                 2.091479  \n",
       "177     310.00                 0.413703  \n",
       "178    1300.00                24.809160  \n",
       "179       2.80                28.000000  \n",
       "180    4100.00                10.910349  \n",
       "181    6600.00                14.589182  \n",
       "182      64.00                 0.684785  \n",
       "183     340.00                 0.538520  \n",
       "184    6000.00                12.181999  \n",
       "185     490.00                 0.153101  \n",
       "186      40.00                 1.174053  \n",
       "187    2200.00                 7.603511  \n",
       "188      16.00                 6.324111  \n",
       "189     480.00                 1.578688  \n",
       "190   17000.00                18.542757  \n",
       "191     990.00                 4.056213  \n",
       "192    3600.00                24.760988  \n",
       "193    5700.00                40.282686  \n",
       "\n",
       "[194 rows x 4 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "populationColumn = data['Population (1000s)']\n",
    "data['TB deaths (per 100,000)'] = tbColumn * 100 / populationColumn\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we sort the data by rate we get a clear idea of the most affected:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.4/dist-packages/ipykernel/__main__.py:1: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)\n",
      "  if __name__ == '__main__':\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Population (1000s)</th>\n",
       "      <th>TB deaths</th>\n",
       "      <th>TB deaths (per 100,000)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>San Marino</td>\n",
       "      <td>31</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>Monaco</td>\n",
       "      <td>38</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.078947</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>Norway</td>\n",
       "      <td>5043</td>\n",
       "      <td>4.40</td>\n",
       "      <td>0.087250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>16759</td>\n",
       "      <td>20.00</td>\n",
       "      <td>0.119339</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>Qatar</td>\n",
       "      <td>2169</td>\n",
       "      <td>2.70</td>\n",
       "      <td>0.124481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>9571</td>\n",
       "      <td>13.00</td>\n",
       "      <td>0.135827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>New Zealand</td>\n",
       "      <td>4506</td>\n",
       "      <td>6.30</td>\n",
       "      <td>0.139814</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>United States of America</td>\n",
       "      <td>320051</td>\n",
       "      <td>490.00</td>\n",
       "      <td>0.153101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Belgium</td>\n",
       "      <td>11104</td>\n",
       "      <td>18.00</td>\n",
       "      <td>0.162104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>Canada</td>\n",
       "      <td>35182</td>\n",
       "      <td>62.00</td>\n",
       "      <td>0.176226</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Australia</td>\n",
       "      <td>23343</td>\n",
       "      <td>45.00</td>\n",
       "      <td>0.192777</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>Montenegro</td>\n",
       "      <td>621</td>\n",
       "      <td>1.20</td>\n",
       "      <td>0.193237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>Cyprus</td>\n",
       "      <td>1141</td>\n",
       "      <td>2.30</td>\n",
       "      <td>0.201578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>Israel</td>\n",
       "      <td>7733</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0.206905</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>8078</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0.210448</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>Czech Republic</td>\n",
       "      <td>10702</td>\n",
       "      <td>28.00</td>\n",
       "      <td>0.261633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>Iceland</td>\n",
       "      <td>330</td>\n",
       "      <td>0.93</td>\n",
       "      <td>0.281818</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>Finland</td>\n",
       "      <td>5426</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0.313306</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>Cuba</td>\n",
       "      <td>11266</td>\n",
       "      <td>37.00</td>\n",
       "      <td>0.328422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Andorra</td>\n",
       "      <td>79</td>\n",
       "      <td>0.26</td>\n",
       "      <td>0.329114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Austria</td>\n",
       "      <td>8495</td>\n",
       "      <td>29.00</td>\n",
       "      <td>0.341377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105</th>\n",
       "      <td>Malta</td>\n",
       "      <td>429</td>\n",
       "      <td>1.50</td>\n",
       "      <td>0.349650</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>Germany</td>\n",
       "      <td>82727</td>\n",
       "      <td>300.00</td>\n",
       "      <td>0.362639</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>Ireland</td>\n",
       "      <td>4627</td>\n",
       "      <td>18.00</td>\n",
       "      <td>0.389021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>Turkey</td>\n",
       "      <td>74933</td>\n",
       "      <td>310.00</td>\n",
       "      <td>0.413703</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>Luxembourg</td>\n",
       "      <td>530</td>\n",
       "      <td>2.20</td>\n",
       "      <td>0.415094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>Denmark</td>\n",
       "      <td>5619</td>\n",
       "      <td>24.00</td>\n",
       "      <td>0.427122</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Bahamas</td>\n",
       "      <td>377</td>\n",
       "      <td>1.80</td>\n",
       "      <td>0.477454</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>Jordan</td>\n",
       "      <td>7274</td>\n",
       "      <td>35.00</td>\n",
       "      <td>0.481166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>Italy</td>\n",
       "      <td>60990</td>\n",
       "      <td>310.00</td>\n",
       "      <td>0.508280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Cabo Verde</td>\n",
       "      <td>499</td>\n",
       "      <td>150.00</td>\n",
       "      <td>30.060120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>Ethiopia</td>\n",
       "      <td>94101</td>\n",
       "      <td>30000.00</td>\n",
       "      <td>31.880639</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Angola</td>\n",
       "      <td>21472</td>\n",
       "      <td>6900.00</td>\n",
       "      <td>32.134873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>Papua New Guinea</td>\n",
       "      <td>7321</td>\n",
       "      <td>2400.00</td>\n",
       "      <td>32.782407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>Cameroon</td>\n",
       "      <td>22254</td>\n",
       "      <td>7800.00</td>\n",
       "      <td>35.049879</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>106</th>\n",
       "      <td>Marshall Islands</td>\n",
       "      <td>53</td>\n",
       "      <td>21.00</td>\n",
       "      <td>39.622642</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160</th>\n",
       "      <td>South Sudan</td>\n",
       "      <td>11296</td>\n",
       "      <td>4500.00</td>\n",
       "      <td>39.837110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>14150</td>\n",
       "      <td>5700.00</td>\n",
       "      <td>40.282686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>30552</td>\n",
       "      <td>13000.00</td>\n",
       "      <td>42.550406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>153</th>\n",
       "      <td>Sierra Leone</td>\n",
       "      <td>6092</td>\n",
       "      <td>2600.00</td>\n",
       "      <td>42.678923</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>Congo</td>\n",
       "      <td>4448</td>\n",
       "      <td>2000.00</td>\n",
       "      <td>44.964029</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>Lesotho</td>\n",
       "      <td>2074</td>\n",
       "      <td>960.00</td>\n",
       "      <td>46.287367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>South Africa</td>\n",
       "      <td>52776</td>\n",
       "      <td>25000.00</td>\n",
       "      <td>47.370017</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>Central African Republic</td>\n",
       "      <td>4616</td>\n",
       "      <td>2200.00</td>\n",
       "      <td>47.660312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>Myanmar</td>\n",
       "      <td>53259</td>\n",
       "      <td>26000.00</td>\n",
       "      <td>48.818040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>Liberia</td>\n",
       "      <td>4294</td>\n",
       "      <td>2100.00</td>\n",
       "      <td>48.905449</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Bangladesh</td>\n",
       "      <td>156595</td>\n",
       "      <td>80000.00</td>\n",
       "      <td>51.087199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>Madagascar</td>\n",
       "      <td>22925</td>\n",
       "      <td>12000.00</td>\n",
       "      <td>52.344602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>Lao People's Democratic Republic</td>\n",
       "      <td>6770</td>\n",
       "      <td>3600.00</td>\n",
       "      <td>53.175775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>Gabon</td>\n",
       "      <td>1672</td>\n",
       "      <td>910.00</td>\n",
       "      <td>54.425837</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>Namibia</td>\n",
       "      <td>2303</td>\n",
       "      <td>1300.00</td>\n",
       "      <td>56.448111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>Cambodia</td>\n",
       "      <td>15135</td>\n",
       "      <td>10000.00</td>\n",
       "      <td>66.072019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>Democratic Republic of the Congo</td>\n",
       "      <td>67514</td>\n",
       "      <td>46000.00</td>\n",
       "      <td>68.134017</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>Mozambique</td>\n",
       "      <td>25834</td>\n",
       "      <td>18000.00</td>\n",
       "      <td>69.675621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>Guinea-Bissau</td>\n",
       "      <td>1704</td>\n",
       "      <td>1200.00</td>\n",
       "      <td>70.422535</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>Somalia</td>\n",
       "      <td>10496</td>\n",
       "      <td>7700.00</td>\n",
       "      <td>73.361280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>Timor-Leste</td>\n",
       "      <td>1133</td>\n",
       "      <td>990.00</td>\n",
       "      <td>87.378641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>Swaziland</td>\n",
       "      <td>1250</td>\n",
       "      <td>1100.00</td>\n",
       "      <td>88.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>Nigeria</td>\n",
       "      <td>173615</td>\n",
       "      <td>160000.00</td>\n",
       "      <td>92.157936</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>Djibouti</td>\n",
       "      <td>873</td>\n",
       "      <td>870.00</td>\n",
       "      <td>99.656357</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>194 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                              Country  Population (1000s)  TB deaths  \\\n",
       "147                        San Marino                  31       0.00   \n",
       "111                            Monaco                  38       0.03   \n",
       "126                            Norway                5043       4.40   \n",
       "120                       Netherlands               16759      20.00   \n",
       "137                             Qatar                2169       2.70   \n",
       "166                            Sweden                9571      13.00   \n",
       "121                       New Zealand                4506       6.30   \n",
       "185          United States of America              320051     490.00   \n",
       "16                            Belgium               11104      18.00   \n",
       "32                             Canada               35182      62.00   \n",
       "8                           Australia               23343      45.00   \n",
       "113                        Montenegro                 621       1.20   \n",
       "44                             Cyprus                1141       2.30   \n",
       "82                             Israel                7733      16.00   \n",
       "167                       Switzerland                8078      17.00   \n",
       "45                     Czech Republic               10702      28.00   \n",
       "76                            Iceland                 330       0.93   \n",
       "60                            Finland                5426      17.00   \n",
       "43                               Cuba               11266      37.00   \n",
       "3                             Andorra                  79       0.26   \n",
       "9                             Austria                8495      29.00   \n",
       "105                             Malta                 429       1.50   \n",
       "65                            Germany               82727     300.00   \n",
       "81                            Ireland                4627      18.00   \n",
       "177                            Turkey               74933     310.00   \n",
       "99                         Luxembourg                 530       2.20   \n",
       "48                            Denmark                5619      24.00   \n",
       "11                            Bahamas                 377       1.80   \n",
       "86                             Jordan                7274      35.00   \n",
       "83                              Italy               60990     310.00   \n",
       "..                                ...                 ...        ...   \n",
       "29                         Cabo Verde                 499     150.00   \n",
       "58                           Ethiopia               94101   30000.00   \n",
       "4                              Angola               21472    6900.00   \n",
       "131                  Papua New Guinea                7321    2400.00   \n",
       "31                           Cameroon               22254    7800.00   \n",
       "106                  Marshall Islands                  53      21.00   \n",
       "160                       South Sudan               11296    4500.00   \n",
       "193                          Zimbabwe               14150    5700.00   \n",
       "0                         Afghanistan               30552   13000.00   \n",
       "153                      Sierra Leone                6092    2600.00   \n",
       "39                              Congo                4448    2000.00   \n",
       "95                            Lesotho                2074     960.00   \n",
       "159                      South Africa               52776   25000.00   \n",
       "33           Central African Republic                4616    2200.00   \n",
       "116                           Myanmar               53259   26000.00   \n",
       "96                            Liberia                4294    2100.00   \n",
       "13                         Bangladesh              156595   80000.00   \n",
       "100                        Madagascar               22925   12000.00   \n",
       "92   Lao People's Democratic Republic                6770    3600.00   \n",
       "62                              Gabon                1672     910.00   \n",
       "117                           Namibia                2303    1300.00   \n",
       "30                           Cambodia               15135   10000.00   \n",
       "47   Democratic Republic of the Congo               67514   46000.00   \n",
       "115                        Mozambique               25834   18000.00   \n",
       "71                      Guinea-Bissau                1704    1200.00   \n",
       "158                           Somalia               10496    7700.00   \n",
       "172                       Timor-Leste                1133     990.00   \n",
       "165                         Swaziland                1250    1100.00   \n",
       "124                           Nigeria              173615  160000.00   \n",
       "49                           Djibouti                 873     870.00   \n",
       "\n",
       "     TB deaths (per 100,000)  \n",
       "147                 0.000000  \n",
       "111                 0.078947  \n",
       "126                 0.087250  \n",
       "120                 0.119339  \n",
       "137                 0.124481  \n",
       "166                 0.135827  \n",
       "121                 0.139814  \n",
       "185                 0.153101  \n",
       "16                  0.162104  \n",
       "32                  0.176226  \n",
       "8                   0.192777  \n",
       "113                 0.193237  \n",
       "44                  0.201578  \n",
       "82                  0.206905  \n",
       "167                 0.210448  \n",
       "45                  0.261633  \n",
       "76                  0.281818  \n",
       "60                  0.313306  \n",
       "43                  0.328422  \n",
       "3                   0.329114  \n",
       "9                   0.341377  \n",
       "105                 0.349650  \n",
       "65                  0.362639  \n",
       "81                  0.389021  \n",
       "177                 0.413703  \n",
       "99                  0.415094  \n",
       "48                  0.427122  \n",
       "11                  0.477454  \n",
       "86                  0.481166  \n",
       "83                  0.508280  \n",
       "..                       ...  \n",
       "29                 30.060120  \n",
       "58                 31.880639  \n",
       "4                  32.134873  \n",
       "131                32.782407  \n",
       "31                 35.049879  \n",
       "106                39.622642  \n",
       "160                39.837110  \n",
       "193                40.282686  \n",
       "0                  42.550406  \n",
       "153                42.678923  \n",
       "39                 44.964029  \n",
       "95                 46.287367  \n",
       "159                47.370017  \n",
       "33                 47.660312  \n",
       "116                48.818040  \n",
       "96                 48.905449  \n",
       "13                 51.087199  \n",
       "100                52.344602  \n",
       "92                 53.175775  \n",
       "62                 54.425837  \n",
       "117                56.448111  \n",
       "30                 66.072019  \n",
       "47                 68.134017  \n",
       "115                69.675621  \n",
       "71                 70.422535  \n",
       "158                73.361280  \n",
       "172                87.378641  \n",
       "165                88.000000  \n",
       "124                92.157936  \n",
       "49                 99.656357  \n",
       "\n",
       "[194 rows x 4 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.sort('TB deaths (per 100,000)')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Conclusions\n",
    "\n",
    "The all the countries had a total of about one million deaths due to TB in 2013. The median shows that half of these coutries had fewer than 315 deaths. The much higher mean (over 5,000) indicates that some countries had a very high number. The least affected were San Marino, Monaco and Norway, with 0,0.08 and 0.09 deaths rate per 100,000  respectively, and the most affected were Djibouti and Nigeria with 99.6 and 92 deaths per population of 100,000. In number of deaths the most affected where Nigeria and India with 160,000 and 240,000 deaths in the year 2013.\n",
    "\n",
    "One should not forget that most values are estimates, and that the chosen countries are a small sample of all the world's countries. Nevertheless, they convey the message that TB is still a major cause of fatalities, and that there is a huge disparity between countries, with several ones being highly affected."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
